// 路由配置
import Vue from 'vue'
import Router from 'vue-router'
import MyMain from '../components/Main/MyMain.vue'//主页面
import AddUser  from '@/components/User/AddUser.vue'//添加用户
import DelUser from '@/components/User/DelUser.vue'//删除用户
import MyUser from '@/components/User/MyUser.vue'//展示用户信息
import AddDevice from '@/components/Device/AddDevice.vue'//添加设备
import DelDevice from '@/components/Device/DelDevice.vue'//移除设备
import MyDevice from '@/components/Device/MyDevice.vue'//展示设备
import MyPage from '@/components/WelCome/MyPage.vue'//欢迎页面
import LoginUserVue from '../components/Login/LoginUser.vue'//登录页面
import RegisterUserVue from '../components/Login/RegisterUser.vue'
import GetMore from '@/components/Device/getMore.vue'// 设备详情界面
import Success from '@/components/ReturnResult/MySuccess.vue'
import Error from '@/components/ReturnResult/MyError.vue'
import UserSuccess from '@/components/ReturnResult/UserSuccess.vue'
import UserError from '@/components/ReturnResult/UserError.vue'
import DeviceMap from '@/components/Device/DeviceMap.vue'

Vue.use(Router)

export default new Router({

  routes: [
	{
		path:'/',
		name:'LoginUser',
		component:LoginUserVue//登录页面
	},
    {
      path:'/Login',
      name:'LoginUser',
      component:LoginUserVue//登录页面
    },
	{
      path:'/Login',
      name:'LoginUser',
      component:LoginUserVue//登录页面
    },
	{
		path:'/register',
		name:'RegisterUser',
		component:RegisterUserVue//登录页面
	},
    {
      path: '/Main',
      name: 'Main',
      component: MyMain,// 主页面
      children:[
        {
          path: '',
          name: 'page',
          component: MyPage//默认显示页面
        },
        {
          path:'/map',
          name: 'map',
          component:DeviceMap
        },
        {
          path: '/adduser',
          name: 'AddUser',
          component: AddUser//如下全是子页面
        },
        {
          path: '/deleteuser',
          name: 'DelUser',
          component: DelUser
        },
        {
          path: '/user',
          name: 'MyUser',
          component: MyUser
        },
        {
          path: '/adddevice',
          name: 'AddDevice',
          component: AddDevice
        },
        {
          path: '/deldevice',
          name: 'DelDevice',
          component: DelDevice
        },
        {
          path: '/device',
          name: 'MyDevice',
          component: MyDevice
        },
        {
          path: '/page',
          name: 'page',
          component: MyPage
        },
        {
          path: '/getmore',
          name:'getMore',
          component: GetMore
        },
        {
          path: '/success',
          name:'success',
          component:Success
        },
        {
          path: '/error',
          name:'error',
          component:Error
          
        },
        {
          path: '/usersuccess',
          name:'usersuccess',
          component:UserSuccess
        },
        {
          path: '/usererror',
          name:'usererror',
          component:UserError
          
        }
      ]
    }
  ],
})

